@extends('host.custom.common.common')

@section('c-head')
    <script type="text/javascript">
        var PAGE_DATA = {
            pagingObj : {
                total : 0,
                pageSize : 4,
                page : 1
            },
            orderListData : $.parseJSON('{!! $orders !!}')
        };
    </script>
    @stop

    @section('body')
            <!-- top_test -->
    <div id="top_test"></div>

    <!-- web_logo_search -->
    <div id="web_logo_search"></div>

    <!-- comm_nav -->
    <div id="comm_nav"></div>

    <div class="com-w mt20">
        <div class="wrapper clearfix">
            <div id="commleftmenu" class="w220 mr20 comm-left-menu">
                <div class="menu-top-title">采购商中心</div>
                <div id="leftmenuitems"></div>
            </div>
            <div class="w960 comm-main">
                <div class="main-release clearfix">
                    <div class="main-release-nav">
                        您当前的位置：
                        <a href="javascript:void(0)">首页</a>
                        >
                        <a href="javascript:void(0)">采购商中心</a>
                        > 订单管理
                    </div>
                    <div class="main-release-title">
                        <span class="icons"></span>
                        <span class="release-title-h3 f16">订单管理</span>
                    </div>
                    <div class="main-release-from">
                        <div id="commTabs_1" class="comm-tabs">
                            <div class="comm-tabs-head">
                                <div class="head-item current">所有订单</div>
                                <div class="head-item">待物流报价</div>
                                <div class="head-item">待付款</div>
                                <div class="head-item">待发货</div>
                                <div class="head-item">已发货</div>
                                <div class="head-item">已完成</div>
                                <div class="head-item">已取消</div>
                            </div>
                            <div class="comm-tabs-body">
                                <!-- 0所有订单 -->
                                <div id="order-list-body-0" class="body-item" style="display:block;">
                                    <div class="h60 w960">
                                        <div class="closing-time f14">
                                            订单号：
                                            <input type="text" class="sel-order-serial" />
                                            下单时间：
                                            <input type="text" class="sel-order-time-1" readonly />
                                            -
                                            <input type="text" class="sel-order-time-2" readonly />
                                            供应商店铺名称:
                                            <input type="text"  class="sel-buyer-name">
                                            <div class="btn btn-warn btn-w70x32 sel-search-btn">搜索</div>
                                        </div>
                                    </div>

                                    <div class="container"></div>

                                    <div id="comm-paging-0" class="comm-paging"
                                         style="float:right; margin-right:20px; margin-bottom:10px;"></div>
                                    <input type="hidden" class="sel-status" value="0" />
                                </div>

                                <!-- 1 待物流报价-->
                                <div id="order-list-body-1" class="body-item">
                                    <div class="h60 w960">
                                        <div class="closing-time f14">
                                            订单号：
                                            <input type="text" class="sel-order-serial" /> 下单时间：
                                            <input type="text" class="sel-order-time-1" /> -
                                            <input type="text" class="sel-order-time-2" /> 供应商店铺名称:
                                            <input type="text" class="sel-buyer-name" />
                                            <div class="btn btn-warn btn-w70x32 sel-search-btn">
                                                搜索
                                            </div>
                                        </div>
                                    </div>
                                    <div class="container"></div>
                                    <div id="comm-paging-1" class="comm-paging" style="float:right; margin-right:20px; margin-bottom:10px;"></div>
                                    <input type="hidden" class="sel-status" value="1" />
                                </div>


                                <!-- 2待付款 -->
                                <div id="order-list-body-2" class="body-item">
                                    <div class="h60 w960">
                                        <div class="closing-time f14">
                                            订单号：
                                            <input type="text" class="sel-order-serial" />
                                            下单时间：
                                            <input type="text" class="sel-order-time-1" />
                                            -
                                            <input type="text" class="sel-order-time-2" />
                                            供应商店铺名称:
                                            <input type="text"  class="sel-buyer-name">
                                            <div class="btn btn-warn btn-w70x32 sel-search-btn">搜索</div>
                                        </div>
                                    </div>

                                    <div class="container"></div>


                                    <div id="comm-paging-2"
                                         class="comm-paging"
                                         style="float:right; margin-right:20px; margin-bottom:10px;"></div>

                                    <input type="hidden" class="sel-status" value="2" />
                                </div>

                                <!-- 3待发货 -->
                                <div id="order-list-body-3" class="body-item">

                                    <div class="h60 w960">
                                        <div class="closing-time f14">
                                            订单号：
                                            <input type="text" class="sel-order-serial" />
                                            下单时间：
                                            <input type="text" class="sel-order-time-1" />
                                            -
                                            <input type="text" class="sel-order-time-2" />
                                            供应商店铺名称:
                                            <input type="text"  class="sel-buyer-name">
                                            <div class="btn btn-warn btn-w70x32 sel-search-btn">搜索</div>
                                        </div>
                                    </div>

                                    <div class="container"></div>

                                    <div id="comm-paging-3"
                                         class="comm-paging"
                                         style="float:right; margin-right:20px; margin-bottom:10px;"></div>


                                    <input type="hidden" class="sel-status" value="3" />
                                </div>

                                <!-- 4 已发货  已收货 收货评价 等等-->
                                <div id="order-list-body-4" class="body-item">

                                    <div class="h60 w960">
                                        <div class="closing-time f14">
                                            订单号：
                                            <input type="text" class="sel-order-serial" />
                                            下单时间：
                                            <input type="text" class="sel-order-time-1" />
                                            -
                                            <input type="text" class="sel-order-time-2" />
                                            供应商店铺名称:
                                            <input type="text"  class="sel-buyer-name">
                                            <div class="btn btn-warn btn-w70x32 sel-search-btn">搜索</div>
                                        </div>
                                    </div>

                                    <div class="container"></div>

                                    <div id="comm-paging-4"
                                         class="comm-paging"
                                         style="float:right; margin-right:20px; margin-bottom:10px;"></div>

                                    <input type="hidden" class="sel-status" value="4" />
                                </div>

                                <!-- 5 已完成-->
                                <div id="order-list-body-5" class="body-item">

                                    <div class="h60 w960">
                                        <div class="closing-time f14">
                                            订单号：
                                            <input type="text" class="sel-order-serial" />
                                            下单时间：
                                            <input type="text" class="sel-order-time-1" />
                                            -
                                            <input type="text" class="sel-order-time-2" />
                                            供应商店铺名称:
                                            <input type="text"  class="sel-buyer-name">
                                            <div class="btn btn-warn btn-w70x32 sel-search-btn">搜索</div>
                                        </div>
                                    </div>

                                    <div class="container"></div>

                                    <div id="comm-paging-5"
                                         class="comm-paging"
                                         style="float:right; margin-right:20px; margin-bottom:10px;"></div>

                                    <input type="hidden" class="sel-status" value="5" />
                                </div>

                                <!-- 6 已取消-->
                                <div id="order-list-body-6" class="body-item">

                                    <div class="h60 w960">
                                        <div class="closing-time f14">
                                            订单号：
                                            <input type="text" class="sel-order-serial" />
                                            下单时间：
                                            <input type="text" class="sel-order-time-1" />
                                            -
                                            <input type="text" class="sel-order-time-2" />
                                            供应商店铺名称:
                                            <input type="text"  class="sel-buyer-name">
                                            <div class="btn btn-warn btn-w70x32 sel-search-btn">搜索</div>
                                        </div>
                                    </div>

                                    <div class="container"></div>

                                    <div id="comm-paging-6"
                                         class="comm-paging"
                                         style="float:right; margin-right:20px; margin-bottom:10px;"></div>

                                    <input type="hidden" class="sel-status" value="6" />

                                </div>

                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- foot_nav -->
    <div id="foot_nav"></div>

    <div id="bottom_main"></div>

    <script type="text/template" id="pay-templ">
        <div class="dia-div">
            <div class="tc lh70 h70">您是否确认已经收到以下订单的货品？</div>
            <div class="f14 b002 lh50 tc" style="background-color: #eee;">订单号: <%=orderId%></div>
            <div class="mt15 lh18" style="font-size: 12px;color: #ff500b;  margin-left: 20px;">
                提示：如果您尚未收到货品请不要点击确认，大部分被骗案件都是由于
                提前确认付款被骗的，请谨慎操作！
            </div>
            <div class="t-btn tc mt15">
                <span class="btn btn-gray btn-w140x40 lh28 sel-cancel-btn" i="close">取消</span>
                <span class="btn btn-warn btn-w140x40 lh28 sel-confirm-btn">确认</span>
            </div>
        </div>
    </script>

    <!-- 物流信息 -->
    <script type="text/template" id="logistic-templ">

        <div class="dialog-div">
            <div class="clearfix">
                <div class="top-inp"
                     style="background-color: #FFF5EC;height: 32px;line-height: 32px;color: #ff500b;font-size: 14px;">
                    请输入您的物流信息
                </div>
                <form>
                    <div class="setup-cost clearfix">
                        <div class="setup-cost-l">
                            订单号：
                        </div>
                        <div class="setup-cost-r">
                            <%= orderNo%>
                            <input type="hidden" name="orderNo" value="<%= orderNo%>" />
                        </div>
                    </div>
                    <div class="setup-cost clearfix">
                        <div class="setup-cost-l">
                            配送方式：
                        </div>
                        <div class="setup-cost-r">
                            <input type="text" name="distributeWay" placeholder="请输入物流公司名称" value="<%= distributeWay%>" />
                        </div>
                    </div>
                    <div class="setup-cost clearfix">
                        <div class="setup-cost-l">
                            物流单号：
                        </div>
                        <div class="setup-cost-r">
                            <input type="text" name="logisticNo" placeholder="请输入物流单号" value="<%= logisticNo%>" />
                        </div>
                    </div>
                </form>

            </div>
            <div class="price-game-btn">
                <div class="btn btn-gray btn-w140x40 remove sel-cancel-btn">
                    取消
                </div>
                <div class="btn btn-warn btn-w140x40 sel-submit-btn">
                    提交
                </div>
            </div>
        </div>

    </script>

    <script type="text/template" id="modify-total-templ">
        <div class="dialog-div">
            <div class="clearfix">
                <div class="setup-cost clearfix">
                    <div class="setup-cost-l">
                        采购商名称：
                    </div>
                    <div class="setup-cost-r">
                        <%= buyerName%>
                    </div>
                </div>
                <div class="setup-cost clearfix">
                    <div class="setup-cost-l">
                        订单号：
                    </div>
                    <div class="setup-cost-r sel-order-num">
                        <%= orderNo%>
                    </div>
                </div>
                <form>
                    <div class="setup-cost clearfix">
                        <div class="setup-cost-l">
                            商品总价：
                        </div>
                        <div class="setup-cost-r">
                            <input type="text" value="<%= goodsTotalPrice%>" name="goodsTotalPrice" />
                            <span>￥<%= goodsTotalPrice%></span>
                        </div>
                    </div>
                    <div class="setup-cost clearfix">
                        <div class="setup-cost-l">
                            配送费用：
                        </div>
                        <div class="setup-cost-r">
                            <input type="text" value="<%= distributePrice%>" name="distributePrice" />
                            <span>￥<%= distributePrice%></span>
                        </div>
                    </div>
                </form>
                <div class="prompt-text w310">
                    输入修改的金额，不要在输入框内加符号或者汉字，只填数字即可
                </div>
                <div class="order-t">
                    <span style="font-size:14px;">订单总价：</span>
     <span style="color:#b00002;font-size:16px;">￥
     <label style="color:#b00002;font-size:16px;" role="orderPriceLabel"><%= orderPrice%></label></span>
                    <input type="hidden" name="orderPrice" value="<%= orderPrice%>"/>
                </div>
            </div>
            <div class="price-game-btn">
                <div class="btn btn-gray btn-w140x40 remove sel-cancel-btn">
                    取消
                </div>
                <div class="btn btn-warn btn-w140x40 sel-submit-btn">
                    提交
                </div>
            </div>
        </div>

    </script>

    <script type="text/template" id="order-templ">
        <% _.each(obj, function(item){ %>
        <div class="order-list mb20 clearfix">
            <div class="order-list-title">
                <div class="list-t-l f14" style="width:300px;">
                    <span style="float:left;line-height: 35px;width:50px;">订单号： </span>
                    <span class="order-num f14"><%=item.orderid %></span>
                </div>
                <div class="list-t-m f14">
                    店铺名：
                    <span class="shop-name f14"><%=item.storeName %></span>
                </div>
                <div class="list-t-r f14">
                    订单状态：
                    <span class="shop-name f14"><%=item.orderStatusTxt %></span>
                </div>
            </div>
            <div class="clearfix">
                <div class="s4-tab border-none order-management">
                    <div class="head">
                        <ul>
                            <li class="wb10"></li>
                            <li class="wb40 tl">商品名称</li>
                            <li class="wb15">采购价</li>
                            <li class="wb15">采购数量</li>
                            <li class="wb20">小计</li>
                        </ul>
                    </div>

                    <div class="order-manag-main">

                        <% _.each(item.goodsList, function(goodItem){ %>
                        <ul class="clearfix">
                            <li class="wb10"> <a href="<%=goodItem.goodHref %>"> <img src="<%=goodItem.goodImg %>" /></a> </li>
                            <li class="wb40">
                                <div class="clearfix" >
                                    <a href="<%=goodItem.goodHref %>" class="c-coffee fl mt5" style="line-height: 36px;">
                                        <%=goodItem.goodName %></a>
                                </div>
                                <div class="f12 c-999 " style="text-align:left;">

                                    <%=goodItem.shortInfo %>

                                </div>
                            </li>
                            <li class="wb15 lh80 b002">￥<%=goodItem.price %></li>
                            <li class="wb15 lh80 c-666"><%=goodItem.amount %></li>
                            <li class="wb20 lh80 b002">￥<%=goodItem.total %></li>
                        </ul>
                        <% }); %>

                    </div>
                </div>
            </div>

            <div class="list-bottom">
                <div class="list-b-l f14 fl">
                    提交时间：
                    <span class="order-num f14 ml0"><%=item.orderTime %> </span>
                </div>
                <div class="list-t-m f14 fl">
    <span class="fl f14">
        支付方式：
    </span>

                    <span class="shop-name f14 fr tl ml0" style="width: 90px;height: 60px;line-height: 64px"><%=item.payWay %></span>
                </div>
                <div class="list-t-r f14 fl ml0">
                    订单总额：
                    <span class="shop-name f18 b002 ml0">￥<%=item.orderTotal %> </span>
                </div>
                <div class="clearfix fr" order-id="<%=item.orderid%>">
                    <a href="<%=item.orderDetailHerf %>" class="btn btn-default btn-w80x30 fr ml5 mt15 mr10" style="display:block;">查看订单</a>

                    <% if(item.orderStatusVal == "1"){  %>
                            <!--  1-待物流报价 sel-modify-total-btn -->
                    <span class="btn btn-default btn-w80x30 fr mt15 mr5 sel-cacel-btn">取消订单</span>
                    <% } else if(item.orderStatusVal == "2") {%>
                            <!--  2-待付款 -->
                    <span class="btn btn-important btn-w80x30 fr mt15 mr5 sel-pay-btn" >付款</span>
                    <% } else if(item.orderStatusVal == "3") {%>
                            <!-- 3-待发货 sel-send-btn 发货 -->
                    <span class="btn btn-important btn-w80x30 fr mt15 mr5 " style="visibility:hidden;"></span>
                    <% } else if(item.orderStatusVal == "4") {%>
                            <!-- 4-已发货  sel-modify-order-btn-->
                    <span class="btn btn-important btn-w80x30 fr mt15 mr5 " style="visibility:hidden;" >修改单号</span>
                    <% } else if(item.orderStatusVal == "5") {%>
                            <!-- 5-已完成  -->
                    <span class="btn btn-important btn-w80x30 fr mt15 mr5 sel-rate-btn">我要评价</span>
                    <% }%>
                </div>
            </div>
        </div>
        <% }); %>

    </script>


    <link rel="stylesheet" href="/assets/b2b/css/jquery-ui.min.css">
    <link rel="stylesheet" href="/assets/b2b/css/ui-dialog.css">

    <script type="text/javascript" src="/assets/b2b/js/libs/jquery.validate.min.js"></script>
    <script src="/assets/b2b/js/libs/messages_zh.js"></script>
    <script src="/assets/b2b/js/libs/jquery.paging.min.js"></script>

    <script type="text/javascript" src="/assets/b2b/js/libs/page/common.plugin.js"></script>
    <script type="text/javascript" src="/assets/b2b/js/libs/dialog-min.js"></script>

    <script src="/assets/b2b/js/libs/jquery-ui.min.js"></script>

    <script src="/assets/b2b/js/pageModules/buyer/B4.js"></script>
@stop